package com.parfinex.sims.Filter;


import javax.servlet.*;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import java.io.IOException;

/**
 * @author lijh
 */
public class LoginFilter implements Filter, HttpSessionListener {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("初始化操作正在火热进行中……");
        System.out.println(filterConfig.getFilterName());
        System.out.println(filterConfig.getInitParameter("userName"));
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("阻拦一切不合理的访问哦！");

    }

    @Override
    public void destroy() {
        System.out.println("销毁已完成！");

    }

    @Override
    public void sessionCreated(HttpSessionEvent httpSessionEvent) {

    }

    @Override
    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {

    }
}
